﻿using Hangjing.Common;
using Hangjing.Model;
using Hangjing.SQLServerDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

/// <summary>
/// 配送员账户
/// </summary>
public partial class appH5_myaccount : System.Web.UI.Page
{
    /// <summary>
    /// 配送员账户
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Page_Load(object sender, EventArgs e)
    {

        int pagesize = 8;
        int pageindex = HjNetHelper.GetQueryInt("PageNo", 1);

        int did = HjNetHelper.GetQueryInt("did", 0);

        DeliverInfo deliver = new Deliver().GetModel(did);
        lbmoney.InnerText = deliver.usermoney.ToString();

        string sql = " UserId =  "+did;


  
        IList<deliverAddMoneyLogInfo> orderlist = new deliverAddMoneyLog().GetList(pagesize, pageindex, sql, "dataid", 1);

        WebUtility.BindRepeater(rptorder, orderlist);

        int countNum = new deliverAddMoneyLog().GetCount(sql);
        int pagecount = 0;

        if (countNum % pagesize == 0)
        {
            pagecount = countNum / pagesize;
        }
        else
        {
            pagecount = countNum / pagesize + 1;
        }

        if (pagecount <= 1)
        {
            pages.Style["display"] = "none";
        }
        else
        {
            pages.InnerHtml = WebUtility.GetPageString(pageindex, pagecount, "myaccount.aspx?a=1&did="+did);
        }
    }



}